package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.OrderInfo;
import com.example.teamilkmall.mapper.OrderInfoMapper;
import com.example.teamilkmall.service.OrderInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2025-01-07
 */
@Service
public class OrderInfoServiceImpl implements OrderInfoService {

    private final OrderInfoMapper orderInfoMapper;

    public OrderInfoServiceImpl(OrderInfoMapper orderInfoMapper) {
        this.orderInfoMapper = orderInfoMapper;
    }

    @Override
    public PageInfo<OrderInfo> listOrderInfo(Integer pageSize, Integer pageNum, Integer id) {
        List<OrderInfo> list = orderInfoMapper.listOrderInfo(pageSize,pageNum,id);
        PageInfo<OrderInfo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateOrderInfo(OrderInfo orderInfo) {
        orderInfoMapper.updateOrderInfo(orderInfo);
    }

    @Override
    public void deloneOrderInfo(Integer id) {
        orderInfoMapper.deloneOrderInfo(id);
    }

    @Override
    public void addOrderInfo(OrderInfo orderInfo) {
        orderInfoMapper.addOrderInfo(orderInfo);
    }

    @Override
    public List<OrderInfo> getListOrderInfo() {
        return orderInfoMapper.getListOrderInfo();
    }
}
